package com.ctu.autodial;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.provider.Settings;
import android.util.Log;

/**
 * 接收重启设备广播
 * 
 * @author wxm
 * 
 */
public class RebootBroadCastReceiver extends BroadcastReceiver {

	// **********测试*******************
	private boolean REBOOT_DEBUG = true;// false:关闭重启设备广播

	// *********************************
	@Override
	public void onReceive(Context context, Intent intent) {
		String action = intent.getAction();
		if (action.equals(Intent.ACTION_BOOT_COMPLETED)) {

			if (REBOOT_DEBUG) {
				Intent mainIntent = new Intent(context, MainActivity.class);
				mainIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
				context.startActivity(mainIntent);
			}

		}

	}

}
